import java.util.Arrays;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        int[] arr = { 1,44,23,12,4,56,342,22,45,33,55 };
        int left = 0;
        int right = arr.length-1;
        while (left < right) {
            //从前往后找偶数
            while (left < right && arr[left] % 2 == 1) {
                left++;
            }
            //从后往前找奇数
            while (left < right && arr[right] % 2 == 0) {
                right--;
            }
            //swap
            if (left < right) {
                int tmp = arr[left];
                arr[left] = arr[right];
                arr[right] = tmp;
            }
        }
        for (int x:arr) {
            System.out.print(x+" ");
        }
    }
/*    private static boolean threeConsecutiveOdds(int[] arr) {
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] % 2 == 1) {
                count++;
                if(count == 3) {
                    return true;
                }
            } else {
                count = 0;
            }
        }
        return false;
    }
    public static void main(String[] args) {
        int[] arr = {1, 2, 2, 2, 3, 1, 2, 3};
        boolean flag = threeConsecutiveOdds(arr);
        System.out.println(flag);
    }*/
}
   /* public static int fingSingleOne(int[] arr) {
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum ^= arr[i];
        }
        return sum;
    }
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,1,2,3,4};
        int ret = fingSingleOne(arr);
        System.out.println(ret);
    }*/
   /* public static void main(String[] args) {
        int[] nums = {1,2,7,10,11};
        int target = 9;
        int[] arr = new int[2];
        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j < nums.length; j++) {
                if (nums[i] + nums[j] == target) {
                    arr[0] = i;
                    arr[1] = j;
                    break;
                }
            }
        }
        String str = Arrays.toString(arr);
        System.out.println(str);
    }*/
/*    public static int sum(int[] arr) {
        int Sum = 0;
        for (int i = 0; i < arr.length; i++) {
            Sum += arr[i];
        }
        return Sum;
    }
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6,7,8,9,10};
        int ret = sum(arr);
        System.out.println(ret);
    }*/
    /*public static void transform(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            arr[i] *= 2;
        }
    }
    public static void main(String[] args) {
        int[] arr = {1,2,3};
        transform(arr);
        for (int x:arr) {
            System.out.print(x+" ");
        }
    }*/
    /*public static void main(String[] args) {
        int[] arr = new int[100];
        for (int i = 0; i < 100 ; i++) {
            arr[i] = i+1;
            System.out.print(arr[i]+" ");
        }
    }*/
  /*  public static int binarySearch(int[] arr,int k) {
        int left = 0;
        int right = arr.length-1;
        while (left <= right) {
            int mid = (left + right) / 2;
            if (arr[mid] < k) {
                left = mid + 1;
            } else if (arr[mid] > k) {
                right = mid - 1;
            } else {
                return mid;
            }
        }
        return -1;

    }
    public static void main(String[] args) {
        int[] arr = {5,4,3,88,45,21,645,1};
        Arrays.sort(arr);
        Scanner scanner = new Scanner(System.in);
        int k = scanner.nextInt();
        int ret = binarySearch(arr,k);
        if (ret == -1) {
            System.out.println("找不到该数字");
        } else {
            System.out.println("找到了，该数字下标为"+ret);
        }
       *//* for (int x:arr) {
            System.out.print(x+" ");
        }*//*
    }*/
  /*  public static int find(int[] arr,int k) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == k) {
                return i;
            }
        }
        return -1;
    }
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6,78,9};
        Scanner scanner = new Scanner(System.in);
        int k = scanner.nextInt();
        int ret = find(arr,k);
       if (ret == -1) {
           System.out.println("找不到该数字");
       } else {
           System.out.println("找到了，该数字下标为"+ret);
       }*/
     /*    int arr[] = {1,2,3,4,5};
         int str[] = Arrays.copyOf(arr,arr.length*2);
         int app[] = Arrays.copyOfRange(arr,1,3);
        for (int x:app) {
            System.out.print(x+" ");
        }*/
    /*    int[] arr1 = {1,2,3,45,6};
        int[] arr2 = arr1;
      //  System.out.println(arr2);

        int[] arr3=Arrays.copyOf(arr1,arr1.length*3);
        *//*String ret = Arrays.toString(arr3);
        System.out.println(ret);*//*
        for (int i = 0 ; i < arr3.length; i++) {
            System.out.print(arr3[i]+" ");
        }*/

     /*   for (int x:arr3) {
            System.out.print(x+" ");
        }*/

/*    public static String mytoString(int[] arr) {
        String ret = "[";
        for ( int i = 0; i < arr.length ; i++) {
            ret += arr[i];
            if (i != arr.length-1) {
                ret += ", ";
            }
        }
        ret += "]";
        return ret;
    }
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6};
        String ret = mytoString(arr);
        System.out.println(ret);
    }*/

/*    public static int[] fac() {
        int[] arr1 = {2,3,4,5,6};
        return arr1;

    }

    public static void main(String[] args) {
       int[] arr = {1,2,3,4,5};
       int[] arr2 = new int[arr.length];
        String ret = Arrays.toString(arr);

        System.out.println(ret);*/
      /*  arr2 = fac();
        for (int x :arr2 ) {
            System.out.println(x);
        }*/

       /* int[] arr1 = new int[arr.length];
        arr1 = arr;
        for (int x:arr1) {
            System.out.println(x);
        }
        */
       /* for (int i = 0 ; i < arr.length; i++) {
            System.out.println(i);
        }*/
       /* for (int i = 0 ; i < 5; i++) {
            System.out.println(i);
        }*/
     /*   for (int x : arr) {
            System.out.println(x);
        }*/
      /*  Arrays.toString(arr);
        int[] arr11 = new int[5];
        double[] aee2 = new double[12];
        aee2[1] = 1.1;*/


